package com.bwie.servicemodule.base;

import android.os.Bundle;
import android.support.annotation.Nullable;

import com.bwie.servicemodule.controler.OkGoControler;

/**
 * 有列表的fragment封装
 * */
public abstract class BaseListFragment extends BaseFragment implements OkGoControler.HttpListener{

    protected OkGoControler okGoControler;
    protected String uri = "http://api.yunzhancn.cn/api/app.interface.php?siteid=78703&";

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate( savedInstanceState );
        okGoControler = new OkGoControler();
        okGoControler.setListener( this );

        initDate();
        setListenter();
        setOperation();
    }



    protected abstract void initDate();

    protected abstract void setListenter();

    protected abstract void setOperation();

    protected void showDiadlog(){}

    protected void disDiadlog(){}

    @Override
    public void onSuccess(String url, String result) {
        disDiadlog();
    }

    @Override
    public void onSuccess(String url, String result, int type) {
        disDiadlog();
    }

    @Override
    public void onErro(String url, String msg) {
        disDiadlog();
    }
}
